#ifndef DFRT_OWM_MANAGEMENT_H
#define DFRT_OWM_MANAGEMENT_H
#include <sys/types.h>
#include <dfruntime.h>

#ifdef __cplusplus
extern "C" {
#endif


struct owm_wrdesc {
    int nwrvec;
    int ndecvec;
    struct decvec * decvec;
    struct wrvec * wrvec;
} __packed;

extern void * dfrt_owm_malloc (size_t size );

extern void dfrt_owm_free( void * ptr ) ;

extern void * dfrt_owm_acquire( void * ptr,
                       size_t size,
                       struct owm_wrdesc * owm_wrdesc,
                       bool exclusive );


extern void dfrt_owm_release( void * ptr );


// For internal use :
extern void dfrt_owm_tls_init();
extern void dfrt_owm_taskend_cleanup();

#ifdef __cplusplus
}
#endif

#endif // OWM_MANAGEMENT_H
